Skip to content

[automated] Merge branch 'net11.0' => 'release/11.0.1xx-preview7' - #36944

Merged
kubaflo merged 4 commits into
release/11.0.1xx-preview7from
merge/net11.0-to-release/11.0.1xx-preview7
Jul 30, 2026
Merged

kubaflo merged 4 commits into
release/11.0.1xx-preview7from
merge/net11.0-to-release/11.0.1xx-preview7

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

I detected changes in the net11.0 branch which have not been merged yet to release/11.0.1xx-preview7. I'm a robot and am configured to help you automatically keep release/11.0.1xx-preview7 up to date, so I've opened this PR.

This PR merges commits made on net11.0 by the following committers:

  • NirmalKumarYuvaraj
  • NafeelaNazhir
  • BagavathiPerumal

Instructions for merging from UI

This PR will not be auto-merged. When pull request checks pass, complete this PR by creating a merge commit, not a squash or rebase commit.

merge button instructions

If this repo does not allow creating merge commits from the GitHub UI, use command line instructions.

Instructions for merging via command line

Run these commands to merge this pull request from the command line.

git fetch
git checkout net11.0
git pull --ff-only
git checkout release/11.0.1xx-preview7
git pull --ff-only
git merge --no-ff net11.0

# If there are merge conflicts, resolve them and then run git merge --continue to complete the merge
# Pushing the changes to the PR branch will re-trigger PR validation.
git push https://github.com/dotnet/maui HEAD:merge/net11.0-to-release/11.0.1xx-preview7
or if you are using SSH
git push git@github.com:dotnet/maui HEAD:merge/net11.0-to-release/11.0.1xx-preview7

After PR checks are complete push the branch

git push

Instructions for resolving conflicts

⚠️ If there are merge conflicts, you will need to resolve them manually before merging. You can do this using GitHub or using the command line.

Instructions for updating this pull request

Contributors to this repo have permission update this pull request by pushing to the branch 'merge/net11.0-to-release/11.0.1xx-preview7'. This can be done to resolve conflicts or make other changes to this pull request before it is merged.
The provided examples assume that the remote is named 'origin'. If you have a different remote name, please replace 'origin' with the name of your remote.

git fetch
git checkout -b merge/net11.0-to-release/11.0.1xx-preview7 origin/release/11.0.1xx-preview7
git pull https://github.com/dotnet/maui merge/net11.0-to-release/11.0.1xx-preview7
(make changes)
git commit -m "Updated PR with my changes"
git push https://github.com/dotnet/maui HEAD:merge/net11.0-to-release/11.0.1xx-preview7
or if you are using SSH
git fetch
git checkout -b merge/net11.0-to-release/11.0.1xx-preview7 origin/release/11.0.1xx-preview7
git pull git@github.com:dotnet/maui merge/net11.0-to-release/11.0.1xx-preview7
(make changes)
git commit -m "Updated PR with my changes"
git push git@github.com:dotnet/maui HEAD:merge/net11.0-to-release/11.0.1xx-preview7

Contact .NET Core Engineering (dotnet/dnceng) if you have questions or issues.
Also, if this PR was generated incorrectly, help us fix it. See https://github.com/dotnet/arcade/blob/main/.github/workflows/scripts/inter-branch-merge.ps1.

BagavathiPerumal and others added 4 commits July 30, 2026 15:07
…Source AncestorType bindings (#36905)

> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

### Root Cause

The issue occurs because of a change that taught the XAML source
generator to compile RelativeSource AncestorType bindings at build time
instead of always relying on reflection. This introduced a build warning
(MAUIG2045) whenever a bound property could not be found on the declared
AncestorType .

This check is unsound because AncestorType matching in XAML is
polymorphic: at runtime, the framework walks up the visual tree and
accepts any ancestor whose type matches the declared type or a subclass
of it. A property missing on the declared type (e.g., ContentPage ) may
still be legitimately supplied by a derived class used at runtime (e.g.,
BasePage : ContentPage declaring SelectedItem ). Since the generator
checked only the declared type, it produced false positive warnings that
broke builds using TreatWarningsAsErrors=true .

### Description of Change

The fix narrows the diagnostic condition so MAUIG2045 fires only when
the declared AncestorType is sealed . A sealed type has no subclasses,
so a missing property there provably breaks the binding. For non-sealed
types, the compiler cannot rule out a derived ancestor supplying the
property, so the diagnostic is suppressed and the binding falls back to
reflection at runtime, the same safe fallback already used for
x:Reference bindings.

This is a minimal, one-line change to the diagnostic condition. It was
validated with a regression test reproducing the exact scenario (an
unsealed base page whose subclass supplies the bound property),
confirming the test fails without the fix and passes with it, while the
rest of the test suite is unaffected.

### Regression PR

PR #34408

Tested the behavior in the following platforms.
 
- [x] Android
- [x] Mac
- [x] iOS
- [x] Windows

### Issues Fixed

Fixes #36818

### Output

|Before Fix|After Fix|
|--|--|
<video
src="https://github.com/user-attachments/assets/b53cfaa0-40ca-46a1-b8e4-9d968ee013d0">
|<video
src="https://github.com/user-attachments/assets/2ac03219-e022-4115-a225-81cb44f487f6">|
…11 (#36932)

Description:
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

 ### Description of Change

CollectionView UI tests on Windows were failing in CI because the
visual-regression snapshot baselines no longer matched the current
rendered output. This PR updates the snapshot images used by these tests
so they reflect the correct expected UI, resolving the CI failures.

**Changes:**
- Updated baseline snapshot `windows/HeaderAndFooterShouldBeVisible.png`
- Updated baseline snapshot
`windows/CollectionViewSelectionShouldClear.png`

**Issue Fixed**
 Fixes #36810
…on behavior (#30875)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

### Description of Change

Annotates the remaining .NET MAUI Controls type converters for nullable
reference types and updates the seven platform PublicAPI ledgers to
match their actual override contracts.

The review also uncovered and fixes several converter failure paths:

- `StrokeShapeTypeConverter`
  - Honors the culture supplied to direct `TypeConverter` calls.
  - Keeps XAML and XamlC numeric parsing invariant and exponent-aware.
- Makes XamlC emit a `RoundRectangle` for a numeric radius instead of
constructing a `Rectangle` and invoking a `RoundRectangle` setter on it.
- `FontAttributesConverter`
  - Produces comma-separated output that round-trips.
- Continues rejecting malformed comma tokens while treating
whitespace-only input as `FontAttributes.None`.
- `BindablePropertyConverter`
- Returns `null` rather than throwing a `NullReferenceException` for
unresolved direct-converter type names.
- Validates truncated VisualState parent chains and reports
`XamlParseException` with the most specific available diagnostic.
- Simplifies converter implementations without changing valid-input
mappings, including `TextAlignmentConverter`.

### Root Cause

Several converters still used nullable-oblivious override signatures.
While annotating them, tests exposed assumptions that were hidden by the
old implementation: build-time parsing depended on the build host's
culture, the compiled numeric `StrokeShape` fallback emitted the wrong
shape type, `FontAttributes` used a non-round-trippable separator, and
`BindableProperty` resolution indexed parent chains without checking
their length.

### Compatibility Notes

- Runtime XAML, CSS, and the current SourceGen fallback use invariant
conversion.
- Direct `TypeConverter.ConvertFrom(context, culture, value)` calls
honor the supplied culture.
- No public members are added or removed; the PublicAPI updates record
nullability annotations for existing overrides.

### What NOT to Do

- Do not use the build host's current culture when compiling numeric
XAML literals.
- Do not skip empty `FontAttributes` tokens; malformed comma-delimited
values must remain errors.
- Do not enable the optimized SourceGen `StrokeShapeConverter` until its
numeric `RoundRectangle` fallback is implemented.

### Validation

- `dotnet cake --target=dotnet-build --configuration=Release
--verbosity=normal`
- 60 focused Controls Core converter tests
- 24 focused XAML tests covering Runtime, XamlC, SourceGen fallback,
culture isolation, and VisualState parent-chain diagnostics

### Issues Fixed

No linked issue.

---------

Co-authored-by: Tamilarasan Paranthaman <93904422+Tamilarasan-Paranthaman@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a6db2315-d16d-4f19-94ec-2e5a7cbccda6
Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
Reset patterns:
- global.json
- NuGet.config
- eng/Version.Details.xml
- eng/Versions.props
- eng/common/*
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

@kubaflo
kubaflo merged commit e742dc3 into release/11.0.1xx-preview7 Jul 30, 2026
17 of 29 checks passed
@kubaflo
kubaflo deleted the merge/net11.0-to-release/11.0.1xx-preview7 branch July 30, 2026 15:03
@github-actions github-actions Bot added this to the .NET 11.0-preview7 milestone Jul 30, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants